﻿
using FlowCanvas.Nodes;
using NodeCanvas.Framework;
using ParadoxNotion.Design;

namespace Yoozoo.Gameplay.Liberty.Nodes
{
    [Category("Ggame")]
    public class SwitchIsCityTaskGroupNow : FlowControlNode
    {
        public BBParameter<int> groupID;

        public override string name => $"SwitchIsCityTaskGroupNow [{groupID.value}]";

        protected override void RegisterPorts()
        {
            var caseTrue = AddFlowOutput("True");
            var caseFalse = AddFlowOutput("False");
            AddFlowInput("In", (f) =>
            {
                bool passed = BlueprintUtils.IsIndustryCanBuild(groupID.value);
                if (passed)
                {
                    f.Call(caseTrue);
                }
                else
                {
                    f.Call(caseFalse);
                }
            });
        }
    }
}